#include<iostream>
using namespace std;
#include<queue>
const int N = 7e3 + 10;
struct node {
	int x, y, cnt;
};

int nex[4][2] = { {1, 0}, {-1, 0}, {0, 1}, {0, -1} };
const int B = 2020;
int b[N][N];

int bfs()
{
	queue<node> que;
	int cnt = 4;

	que.push(node{ 0 + B, 0 + B, 0 });
	que.push(node{ 2020 + B, 11 + B, 0 });
	que.push(node{ 2000 + B, 2000 + B, 0 });
	que.push(node{ 11 + B, 14 + B, 0 });
	b[0 + B][0 + B] = 1;
	b[2020 + B][11 + B] = 1;
	b[2000 + B][2000 + B] = 1;
	b[11 + B][14 + B] = 1;

	while (!que.empty())
	{
		node u = que.front();
		que.pop();
		if (u.cnt == 2020)
		{
			continue;
		}
		for (int i = 0; i < 4; i++)
		{
			int tx = u.x + nex[i][0], ty = u.y + nex[i][1];
			if (b[tx][ty])
			{
				continue;
			}
			cnt++;
			b[tx][ty] = 1;
			que.push(node{ tx, ty, u.cnt + 1 });
		}
	}
	return cnt;
}

int main()
{
	cout << bfs() << endl;
	return 0;
}
